<html><!-- Created using the cpp_pretty_printer from the dlib C++ library.  See http://dlib.net for updates. --><head><title>dlib C++ Library - simd_check.h</title></head><body bgcolor='white'><pre>
<font color='#009900'>// Copyright (C) 2013  Davis E. King (davis@dlib.net)
</font><font color='#009900'>// License: Boost Software License   See LICENSE.txt for the full license.
</font><font color='#0000FF'>#ifndef</font> DLIB_SIMd_CHECK_Hh_
<font color='#0000FF'>#define</font> DLIB_SIMd_CHECK_Hh_

<font color='#009900'>//#define DLIB_DO_NOT_USE_SIMD
</font>
<font color='#009900'>// figure out which SIMD instructions we can use.
</font><font color='#0000FF'>#ifndef</font> DLIB_DO_NOT_USE_SIMD
    <font color='#0000FF'>#if</font> defined<font face='Lucida Console'>(</font>_MSC_VER<font face='Lucida Console'>)</font> 
        <font color='#0000FF'>#ifdef</font> __AVX__
            <font color='#0000FF'>#ifndef</font> DLIB_HAVE_SSE2
                <font color='#0000FF'>#define</font> DLIB_HAVE_SSE2
            <font color='#0000FF'>#endif</font> 
            <font color='#0000FF'>#ifndef</font> DLIB_HAVE_SSE3
                <font color='#0000FF'>#define</font> DLIB_HAVE_SSE3
            <font color='#0000FF'>#endif</font>
            <font color='#0000FF'>#ifndef</font> DLIB_HAVE_SSE41
                <font color='#0000FF'>#define</font> DLIB_HAVE_SSE41
            <font color='#0000FF'>#endif</font>
            <font color='#0000FF'>#ifndef</font> DLIB_HAVE_AVX
                <font color='#0000FF'>#define</font> DLIB_HAVE_AVX
            <font color='#0000FF'>#endif</font>
        <font color='#0000FF'>#endif</font>
        <font color='#0000FF'>#if</font> <font face='Lucida Console'>(</font>defined<font face='Lucida Console'>(</font> _M_X64<font face='Lucida Console'>)</font> <font color='#5555FF'>|</font><font color='#5555FF'>|</font> defined<font face='Lucida Console'>(</font>_M_IX86_FP<font face='Lucida Console'>)</font> <font color='#5555FF'>&amp;</font><font color='#5555FF'>&amp;</font> _M_IX86_FP <font color='#5555FF'>&gt;</font><font color='#5555FF'>=</font> <font color='#979000'>2</font><font face='Lucida Console'>)</font> <font color='#5555FF'>&amp;</font><font color='#5555FF'>&amp;</font> <font color='#5555FF'>!</font>defined<font face='Lucida Console'>(</font>DLIB_HAVE_SSE2<font face='Lucida Console'>)</font>
            <font color='#0000FF'>#define</font> DLIB_HAVE_SSE2
        <font color='#0000FF'>#endif</font>
    <font color='#0000FF'>#else</font>
        <font color='#0000FF'>#ifdef</font> __SSE2__
            <font color='#0000FF'>#ifndef</font> DLIB_HAVE_SSE2
                <font color='#0000FF'>#define</font> DLIB_HAVE_SSE2
            <font color='#0000FF'>#endif</font> 
        <font color='#0000FF'>#endif</font>
        <font color='#0000FF'>#ifdef</font> __SSSE3__
            <font color='#0000FF'>#ifndef</font> DLIB_HAVE_SSE3
                <font color='#0000FF'>#define</font> DLIB_HAVE_SSE3
            <font color='#0000FF'>#endif</font>
        <font color='#0000FF'>#endif</font>
        <font color='#0000FF'>#ifdef</font> __SSE4_1__
            <font color='#0000FF'>#ifndef</font> DLIB_HAVE_SSE41
                <font color='#0000FF'>#define</font> DLIB_HAVE_SSE41
            <font color='#0000FF'>#endif</font>
        <font color='#0000FF'>#endif</font>
        <font color='#0000FF'>#ifdef</font> __AVX__
            <font color='#0000FF'>#ifndef</font> DLIB_HAVE_AVX
                <font color='#0000FF'>#define</font> DLIB_HAVE_AVX
            <font color='#0000FF'>#endif</font>
        <font color='#0000FF'>#endif</font>
        <font color='#0000FF'>#ifdef</font> __AVX2__
            <font color='#0000FF'>#ifndef</font> DLIB_HAVE_AVX2
                <font color='#0000FF'>#define</font> DLIB_HAVE_AVX2
            <font color='#0000FF'>#endif</font>
        <font color='#0000FF'>#endif</font>
    <font color='#0000FF'>#endif</font>
<font color='#0000FF'>#endif</font>

 
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>#ifdef</font> DLIB_HAVE_SSE2
    <font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>xmmintrin.h<font color='#5555FF'>&gt;</font>
    <font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>emmintrin.h<font color='#5555FF'>&gt;</font>
    <font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>mmintrin.h<font color='#5555FF'>&gt;</font>
<font color='#0000FF'>#endif</font>
<font color='#0000FF'>#ifdef</font> DLIB_HAVE_SSE3
    <font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>pmmintrin.h<font color='#5555FF'>&gt;</font> <font color='#009900'>// SSE3
</font>    <font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>tmmintrin.h<font color='#5555FF'>&gt;</font>
<font color='#0000FF'>#endif</font>
<font color='#0000FF'>#ifdef</font> DLIB_HAVE_SSE41
    <font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>smmintrin.h<font color='#5555FF'>&gt;</font> <font color='#009900'>// SSE4
</font><font color='#0000FF'>#endif</font>
<font color='#0000FF'>#ifdef</font> DLIB_HAVE_AVX
    <font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>immintrin.h<font color='#5555FF'>&gt;</font> <font color='#009900'>// AVX
</font><font color='#0000FF'>#endif</font>
<font color='#0000FF'>#ifdef</font> DLIB_HAVE_AVX2
    <font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>immintrin.h<font color='#5555FF'>&gt;</font> <font color='#009900'>// AVX
</font><font color='#009900'>//    #include &lt;avx2intrin.h&gt;
</font><font color='#0000FF'>#endif</font>

<font color='#0000FF'>#endif</font> <font color='#009900'>// DLIB_SIMd_CHECK_Hh_
</font>


</pre></body></html>